
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <link href="/static/devtools30/layui/css/layui.css" rel="stylesheet" />
    <link href="/static/devtools30/css/devindexbase.css" rel="stylesheet" />
    <script src="/static/devtools30/js/jquery-1.11.2.min.js" type="text/javascript"></script>
    <script src="/static/devtools30/layui/layui.all.js" type="text/javascript"></script>
    <script src="/static/devtools30/js/devtoolCommon.js" type="text/javascript"></script>



    <style>
        .head {
            border: 1px solid #F7F7F7;
            background: #4b505d;
        }

        .head .layui-nav {
            padding: 0!important;
            background: #4b505d!important;
        }

        .head .layui-nav * {
            font-size: 11px!important;
        }

        .head .layui-nav .layui-nav-item {
            height: 28px;
            line-height: 28px;
        }

        .head .layui-nav .layui-this:after,
        .layui-nav-bar,
        .layui-nav-tree .layui-nav-itemed:after {
            height: 0px!important;
        }

        .head .layui-nav .layui-nav-item a:hover,
        .head .layui-nav .layui-nav-item.layui-this a {
            /*color: #FFFFFF!important;*/
            font-weight: bolder!important;
        }

        .head .layui-nav-child {
            display: none;
            position: absolute;
            left: 0;
            top: 30px;
            min-width: 100%;
            line-height: 36px;
            padding: 5px 0;
            box-shadow: 0 2px 4px rgba(0,0,0,.12);
            border: 1px solid #d2d2d2;
            background-color: #fff;
            z-index: 100;
            border-radius: 2px;
            white-space: nowrap;
        }

        .boldwhite{
            color: #FFFFFF!important;
            font-weight: bolder!important;
        }
        .iframeStyle{
            border-width: 3px 6px 6px 6px;border-color: #f7f7f7;border-style: solid;
        }
        .frame{
            display: none;
        }
        .active{
            display: block !important;
        }

    </style>
</head>
<body>
<div>
    <div class="flex flex-align-center flex-jusity-betreen padding010 head">
        <div class="colorf" style="font-size: 12px;" >DLData设计器 |
            <span style=" margin-left: 0px; ">[(${organizationEntity.name})] - [(${organizationEntity.formversion})]</span> |
            <span style=" margin-left: 0px;cursor: pointer; " onclick="importdata()">导入</span> |
            <span style=" margin-left: 0px;cursor: pointer; " onclick="releasedata()">导出</span> |
            <span style=" margin-left: 0px;cursor: pointer; " onclick="clonecfgdata()">克隆</span> |
            <span style=" margin-left: 0px;cursor: pointer; " onclick="releaselog()">发布日志</span>
        </div>
        <div class="layui-nav" lay-filter="tabfilter">
            <ul >
                <li class="layui-nav-item layui-this"><a href="javascript:;" data-href="/V_DevtMetadataIndexController/toList" >模型设计</a></li>
                <li class="layui-nav-item">
                    <a href="javascript:;" data-href="/V_DevtFormListTemplateController/toPage">表单设计</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" data-href="/V_DevtFormListTemplateController/toPage">单一表单设计</a></dd>
                        <dd><a href="javascript:;" data-href="/DevtExcelController/toPage">Excel表单设计</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="javascript:;"  data-href="/V_DevtApiIndexController/toIndexPage">API设计</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" data-href="/V_DevtApiIndexController/toIndexPage?apisubtype=5">查询API</a></dd>
                        <dd><a href="javascript:;" data-href="/V_DevtApiIndexController/toIndexPage?apisubtype=6">更新API</a></dd>
                        <dd><a href="javascript:;" data-href="/V_DevtApiLogEntityController/v_DevtApiLogList">请求日志</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="javascript:;"  data-href="">指标设计</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" data-href="/V_DevtZbobjInfoEntityController/toIndex">指标对象设计</a></dd>
                        <dd><a href="javascript:;" data-href="/V_DevtZbIndexController/toIndex">考核指标设计</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="javascript:;" data-href="/V_DevtZbplanInfoEntityController/toIndex">数据集设计</a></li>
                <li class="layui-nav-item layui-this"><a href="javascript:;" data-href="/DevFunctionListController/toList" >机构功能清单</a></li>
            </ul>
        </div>
    </div>
    <div id="content">
        <div class="frame">
            <iframe class="iframeStyle"  width="99%" src=""></iframe>
        </div>
        <div class="frame">
            <iframe class="iframeStyle"  width="99%" src=""></iframe>
        </div>
        <div class="frame" >
            <iframe class="iframeStyle"  width="99%" src=""></iframe>
        </div>
        <div class="frame" >
            <iframe class="iframeStyle"  width="99%" src=""></iframe>
        </div>
        <div class="frame" >
            <iframe class="iframeStyle"  width="99%" src=""></iframe>
        </div>
        <div class="frame" >
            <iframe class="iframeStyle"  width="99%" src=""></iframe>
        </div>
    </div>
</div>



<div id="selecthospitalversion" class="layui-form" lay-filter="filter-test-layer" style="margin: 16px;display: none;">
    <div class="">
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <select name="hospitalversion" id="hospitalversion" >
                    <option th:each="c : ${hospitalversionList}"  th:value="${c.value}" th:utext="${c.value}">
                    </option>
                </select>
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 30px;">
            <button class="layui-btn layui-btn-fluid" onclick="submitSelectHospital()" >确认</button>
        </div>
    </div>
</div>
<div id="releaselogdiv" class="layui" lay-filter="" style="margin: 1px;display: none;">
    <div class=" flex-jusity-betreen" style="padding: 2px;background: #F7F7F7;">
        <div class="backgroundf" id="releaselogtablediv">
            <table id="releaselogtable" lay-filter="releaselogtable"></table>
        </div>
    </div>
</div>
<div id="clonehospitalversion" class="layui-form" lay-filter="clone_filter" style="margin: 16px;display: none;">
    <div class="">
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <select name="desthospital" id="desthospital" >
                    <option th:each="c : ${hospitalversionList}"  th:value="${c.value}" th:utext="${c.value}">
                    </option>
                </select>
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 30px;">
            <button class="layui-btn layui-btn-fluid" onclick="submitCloneCfgData()" >确认</button>
        </div>
    </div>
</div>
</body>
<script>
    var height=dlCommon.getWinHeight();
    var mutil=true;//是否支持多个iframe
    $(function(){
        /*动态设置iframe高度*/
        var h=document.body.clientHeight
        $('.iframeStyle').height(h - 45)

        initEvent();
        $(".layui-this").children().eq(0).click();

        if(''!='[(${organizationMsg})]'){
            dlCommon.layerError('[(${organizationMsg})]');
        }
    })
    function initEvent(){
        //导航栏菜单点击方法
        layui.element.on('nav(tabfilter)', function(elem){
           var index=mutil?$(".layui-nav-item").index($(elem).parent()):0;
            //console.log(elem[0].id); //得到当前点击的DOM对象
            $('.head .layui-nav .layui-nav-item a').removeClass('boldwhite');
            $(this).addClass('boldwhite')
            var id = elem[0].id;
            var url=$(elem).attr("data-href")
            //元数据
            var current=$('.iframeStyle').eq(index);
            if(url!=current.attr("src")||!mutil)
            current.attr('src',url);

            $(current).parent().addClass('active')
                .siblings().removeClass('active');

        });
        layui.form.render();
        layui.element.render('nav');

    }
    function releasedata(){

        dlCommon.post("/ReleaseAndImportController/releasedata",{},function(res){
            if(res.success){
                dlCommon.layerSuccess(res.msg,function () {
                });
            }else{
                dlCommon.layerError(res.msg);
            }
        },true)
    }

    function importdata(){
        layer.confirm('导入将覆盖当前数据，请备份当前数据并确认是否导入更新？', {
            btn: ['确定', '关闭'] //按钮
        }, function(){
            // layer.msg('第一个回调', {icon: 1});
            layer.open({
                type: 1,
                shade: false, // 不显示遮罩
                area: ['500px', '380px'],
                content: $('#selecthospitalversion'), // 捕获的元素
                title:'选择医院版本',
                end: function(){
                    // layer.msg('关闭后的回调', {icon:6});
                }
            });
            layui.form.render('select');
        }, function(){

        });
    }

    function submitSelectHospital(){
        layer.closeAll();
        var formvalue =layui.form.val('filter-test-layer');
        // var hospitalversion=
        dlCommon.post("/ReleaseAndImportController/importdata",formvalue,function(res){
            if(res.success){
                dlCommon.layerSuccess("操作成功",function () {
                    location.reload();
                });
            }else{
                dlCommon.layerError(res.msg);
            }
        },true)
    }

    function releaselog(){
        dlCommon.post("/ReleaseAndImportController/releaselog",{},function(res){
            if(res.success){
                var argArray=res.data;
                layui.table.render({
                    elem: '#releaselogtable',
                    height: 500,
                    width:"100%",
                    size: 'sm', //小尺寸的表格
                    page:false,
                    cols: [
                        [
                            {field: 'code', title: '机构编码', width: 160, sort: true, align: 'left', halign: 'center',filter:true, edit: 'text'},
                            {field: 'name',title: '机构名称',width: 200,sort: true,align: 'left',halign: 'center'  ,filter:true, edit: 'text' },
                            {field: 'formversion',title: '表单版本',width: 200,sort: true,align: 'left',halign: 'center'  ,filter:true, edit: 'text' },
                            {field: 'releasetimeshow',title: '发布时间',width: 200,sort: true,align: 'left',halign: 'center'  ,filter:true, edit: 'text' },
                        ]
                    ],
                    data: argArray? argArray : [],
                    filter:{
                        bottom:false
                    },
                    done: function () {
                    }
                });

                layer.open({
                    type: 1,
                    shade: false, // 不显示遮罩
                    area: ['800px', '600px'],
                    content: $('#releaselogdiv'), //捕获的元素
                    title:'发布日志',
                    end: function(){
                        //layer.msg('关闭后的回调', {icon:6});
                    }
                });
            }else{
                dlCommon.layerError(res.msg);
            }
        },true);
    }

    function clonecfgdata() {
        layer.open({
            type: 1,
            shade: false, // 不显示遮罩
            area: ['500px', '380px'],
            content: $('#clonehospitalversion'), // 捕获的元素
            title:'选择目标机构',
            end: function(){
                // layer.msg('关闭后的回调', {icon:6});
            }
        });
        layui.form.render('select');
    }

    function submitCloneCfgData(){
        layer.closeAll();
        var formvalue =layui.form.val('clone_filter');
        // var hospitalversion=
        dlCommon.post("/ReleaseAndImportController/submitCloneCfgData",formvalue,function(res){
            if(res.success){
                dlCommon.layerSuccess("操作成功",function () {
                    location.reload();
                });
            }else{
                dlCommon.layerError(res.msg);
            }
        },true)
    }
</script>
</html>
